package com.xkdx.guangguang.fragment.my.pay;

import org.json.JSONArray;
import org.json.JSONObject;

import com.xkdx.guangguang.module.network.AbsModule;

public class PayModule extends AbsModule {
	public String CCB_FOR_PAY_URL;
	public String message;

	// {"Act":"payListCreate","DetailInfo":{"StatusCode":1001,"DetailInfo":"","Message":"商品下架或者被移除,请刷新后重试!"},"Mod":"payChapterAction"}
	@Override
	public void parseData() throws Exception {
		backJson = (JSONArray) result;
		try {
			for (int i = 0; i < backJson.length(); i++) {
				jsonObj = (JSONObject) backJson.get(i);
				String sortOfAct = jsonObj.getString("Act");
				if (sortOfAct.equals("payListCreate")) {
					parserPayGoods(jsonObj.getJSONObject("DetailInfo"));
				}

			}
		} catch (Exception e) {
			throw e;
		}

	}

	private void parserPayGoods(JSONObject person) throws Exception {
		try {
			if (person == null) {
				return;
			}
			String StatusCode = person.getString("StatusCode");
			message=person.getString("Message");
			if (StatusCode.equals("1")) {
				CCB_FOR_PAY_URL = person.getString("DetailInfo");
			} else {
				CCB_FOR_PAY_URL = "";
			}

		} catch (Exception e) {
			throw e;
		}

	}
}
